package com.example.order_service.controller;

import com.example.order_service.model.OrderInfo;
import com.example.order_service.service.OderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/order")
@RestController
public class OrderController {
    @Autowired
    private OderService oderService;

    @RequestMapping("/{orderId}")
//    @PathVariable("orderId")
//    @RequestParam("orderId")
    public OrderInfo getOrderById(@PathVariable("orderId") Integer orderId){
        return  oderService.selectOrderById(orderId);
    }
}
